home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DJEMU106.ARJ / E23.CC < prev    next >
C/C++ Source or Header  |  1991-04-25  |  759b  |  46 lines

  1. #include "emu.h"
  2. #include "rmov.h"
  3. #include "compare.h"
  4.  
  5. void emu_23()
  6. {
  7.   if (empty())
  8.     return;
  9.   if (modrm > 0277)
  10.   {
  11.     emu_bad();
  12.   }
  13.   else
  14.   {
  15.     // ficomp m32int
  16.     reg t;
  17.     r_mov((long *)get_modrm(), t);
  18.     int c = compare(st(), t);
  19.     st().tag = TW_E;
  20.     top++;
  21.     int f;
  22.     if (c & COMP_NAN)
  23.     {
  24.       exception(EX_I);
  25.       f = SW_C3 | SW_C2 | SW_C0;
  26.     }
  27.     else
  28.       switch (c)
  29.       {
  30.         case COMP_A_LT_B:
  31.           f = SW_C0;
  32.           break;
  33.         case COMP_A_EQ_B:
  34.           f = SW_C3;
  35.           break;
  36.         case COMP_A_GT_B:
  37.           f = 0;
  38.           break;
  39.         case COMP_NOCOMP:
  40.           f = SW_C3 | SW_C2 | SW_C0;
  41.           break;
  42.       }
  43.     setcc(f);
  44.   }
  45. }
  46.